<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>旋转立方体相册</title>
</head>
<body>
    <audio autoplay="autoplay" loop="loop" preload="auto"
            	src="./back.mp3">
      		你的浏览器版本太低，不支持audio标签
	</audio>

<div id="react">
    <div class="out_front">
        <img src="./1.jpg" class="out_pic">
    </div>
    <div class="out_back">
        <img src="./2.jpg" class="out_pic">
    </div>
    <div class="out_left">
        <img src="./3.jpg" class="out_pic">
    </div>
    <div class="out_right">
        <img src="./4.jpg" class="out_pic">
    </div>
    <div class="out_top">
        <img src="./5.jpg" class="out_pic">
    </div>
    <div class="out_bottom">
        <img src="./6.jpg" class="out_pic">
    </div>
    <span class="in_front">
        <img src="./7.jpg" class="in_pic">
    </span>
    <span class="in_back">
        <img src="./8.jpg" class="in_pic">
    </span>
    <span class="in_left">
        <img src="./9.jpg" class="in_pic">
    </span>
    <span class="in_right">
        <img src="./10.jpg" class="in_pic">
    </span>
    <span class="in_top">
        <img src="./11.jpg" class="in_pic">
    </span>
    <span class="in_bottom">
        <img src="./12.jpg" class="in_pic">
    </span>
</div>
<style>
    
    body{
    width:100%;
    height:100%;
    background-image:url(./timg1.jfif);
    background-size: 100% 100%; 
}

#react{
    width: 400px;
    height:400px;
    margin: 200px;
    transform-style:preserve-3d;
    animation:rotate 20s infinite;
    animation-timing-function: linear;
}
#react div{
    position:absolute;
    transition: all .4s;
}
div .out_pic{
    width:400px;
    height:400px;
    opacity:0.9;
}
div .in_pic{
    width:200px;
    height:200px;
}
#react span{
    display:block;
    position:absolute;
    width:200px;
    height:200px;
    top:100px;
    left:100px;
}
@keyframes rotate{
    from{transform: rotateX(0deg) rotateY(0deg);}
    to{transform: rotateX(360deg) rotateY(360deg);}
}
  
  
.out_front{
    transform:translateZ(200px);
}
.out_back{
    transform:translateZ(-200px);
}
.out_left{
    transform:rotateY(90deg) translateZ(200px);
}
.out_right{
    transform: rotateY(-90deg) translateZ(200px);
}
.out_top{
    transform:rotateX(90deg) translateZ(200px);
}
.out_bottom{
    transform: rotateX(-90deg) translateZ(200px);
}
.in_front{
    transform:translateZ(100px);
}
.in_back{
    transform:translateZ(-100px);
}
.in_left{
    transform:rotateY(90deg) translateZ(100px);
}
.in_right{
    transform: rotateY(-90deg) translateZ(100px);
}
.in_top{
    transform:rotateX(90deg) translateZ(100px);
}
.in_bottom{
    transform: rotateX(-90deg) translateZ(100px);
}
  
/*外面的图片散开*/
#react:hover .out_front{
    transform:translateZ(400px);
}
#react:hover .out_back{
    transform:translateZ(-400px);
}
#react:hover .out_left{
    transform:rotateY(90deg) translateZ(400px);
}
#react:hover .out_right{
    transform: rotateY(-90deg) translateZ(400px);
}
#react:hover .out_top{
    transform:rotateX(90deg) translateZ(400px);
}
#react:hover .out_bottom{
    transform: rotateX(-90deg) translateZ(400px);
}
  
  
/*里面的图片散开*/
#react:hover .in_front{
    transform:translateZ(200px);
}
#react:hover .in_back{
    transform:translateZ(-200px);
}
#react:hover .in_left{
    transform:rotateY(90deg) translateZ(200px);
}
#react:hover .in_right{
    transform: rotateY(-90deg) translateZ(200px);
}
#react:hover .in_top{
    transform:rotateX(90deg) translateZ(200px);
}
#react:hover .in_bottom{
    transform: rotateX(-90deg) translateZ(200px);
}
  
</style>
</body>
</html>
